package com.hs.pre.module.index;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.hs.core.action.BaseAction;
import com.hs.pre.module.perinfo.PerInfoDAO;
import com.hs.pre.page.PageParam;
import com.hs.pre.page.PageUtil;

public class IndexAction extends BaseAction{
	/*****
	 * 方剂列表
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) { 
 
		 try { 
				 PageParam pageParam = new PageParam(request);
				 pageParam.setPageSize(25);
				 pageParam.setBasePath(request.getContextPath()+"/app/pre/preIndex.do"); 
				 PerInfoDAO perInfoDAO = new PerInfoDAO(); 
				 PageUtil pageUtil = perInfoDAO.getPreList(pageParam); 
				 request.setAttribute("pageUtil", pageUtil); 
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return mapping.findForward("list");
	}
	
}
